// main.ts
import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import App from './App.vue'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import 'virtual:svg-icons-register'
//引入全局组件插件
import globalComponent from './components/index'
import './styles/index.scss'
//暗黑模式需要的样式
import 'element-plus/theme-chalk/dark/css-vars.css'
//引入路由
import router from './router';
import pinia from './store';
import './permisstion';
//引入自定义指令方法
import { isHasButton } from './directive/has'

const app = createApp(App)
//注册全局组件插件
app.use(globalComponent)
app.use(ElementPlus, {
  locale: zhCn, //elemnet-plus国际化配置（中文）
})
app.use(router)
app.use(pinia)
app.mount('#app')
//传入app实例
isHasButton(app);
